package com.itheima.stock.config;

import com.itheima.stock.properties.IdWorkerProperties;
import com.itheima.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**

 * @description
 */
@Configuration
public class IdWorkersConfiguration {

    @Bean
    public IdWorkers idWorkers(IdWorkerProperties properties){
        return new IdWorkers(properties.getMachineId(), properties.getDataCenterId());
    }

}